package com.ck567.practice.mybatisplus.controller;

import com.ck567.practice.mybatisplus.modle.Article;
import com.ck567.practice.mybatisplus.service.ArtivleServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import java.util.Date;

/**
 * @author wuhao
 * @date 2021/1/6 16:32
 */
@Controller
@RequestMapping("/test")
public class TestController {
    @Resource
    ArtivleServiceImpl artivleService;
    @RequestMapping("/test")
    public String hello(){

        for (int i = 1; i <100 ; i++) {
            Article article = new Article();
            article.setId(i);
            article.setAuthor("www");
            article.setContent("测试");
            article.setTitle("ces");
            article.setCreatetime(new Date());
            artivleService.saveArticle(article);
        }
        return "200";
    }
}
